package com.dcjt.firehotcarpad.helper;

import android.app.AlertDialog;
import android.content.Context;
import android.view.View;
import android.widget.TextView;

import com.dcjt.firehotcarpad.R;

/**
 * Created by cj on 2021/1/21.
 * Email:codesexy@163.com
 * Function:
 * desc:
 */
public class MainSelectorHelper {


    private static MainSelectorHelper helper;

    private MainSelectorHelper() {
    }


    public static MainSelectorHelper getInstance() {
        if (helper == null) {
            synchronized (MainSelectorHelper.class) {
                if (helper == null) {
                    helper = new MainSelectorHelper();
                }
            }
        }
        return helper;
    }


    public void select(TextView textView) {
        Context context = textView.getContext();
        View view = View.inflate(context, R.layout.layout_change_sel, null);
        AlertDialog alertDialog = new AlertDialog.Builder(context)
                .setView(view)
                .setCancelable(false)
                .create();
        alertDialog.show();

        view.findViewById(R.id.btCancel).setOnClickListener(v -> alertDialog.dismiss());
    }





}
